package com.roy.spring.aop.demo;


import com.roy.spring.aop.advice.After;
import com.roy.spring.aop.advice.Before;
import com.roy.spring.ioc.annotation.Component;
import com.roy.spring.aop.annotation.Match;

import java.lang.reflect.Method;


/**
 * 
 * @ClassName: TransactionAspect
 * @Description: 事务处理的切面类
 * 
 */
@Component
@Match(methodMatch = "com.*.doSomething")
public class TransactionAspect implements Before,After {


	public void before(Method method, Object[] args) {
		System.out.println("开启事务");
	}


	public void after(Method method, Object[] args, Object retVal) {
		{
			System.out.println("关闭事务");
		}
	}
}
